module.exports = function(lab) {
    return {
        getRegion: function(session, id) {
            return lab.find("slime_regions", id)
        },
        // 省市区列表
        getRegionChildrenByCode: function(session, code) {
            return lab.query("slime_regions", {
                conditions: ["parent_code = ?", "is_removed = ?"],
                params: [code, false]
            }).then(function({ list }) {
                this.next(list)
            })
        }
    }
}